Update help
authorJeroen van der Heijden <jeroen@transceptor.technology>
Thu, 17 May 2018 13:59:00 +0000 (15:59 +0200)
committerJeroen van der Heijden <jeroen@transceptor.technology>
Thu, 17 May 2018 13:59:00 +0000 (15:59 +0200)
help/help_functions.md
help/help_list_series.md
help/help_list_servers.md
help/help_show.md

index cb3adaaec933b76defca9feed55bca4502cddd40..e89328aed47c105ca5b2908909b1a46a38d985b0 100644 (file)
@@ -2,6 +2,16 @@ Aggregate functions
 ===================
 SiriDB supports multiple build-in aggregation and filter functions. Using these functions can be useful to reduce network traffic. Note that multiple functions can be combined using the arrow `=>` sign. (see `help select` for more information on how to use and combine functions)
 
+Most aggregation function accept an optional `ts` argument. When not providing the `ts` argument, SiriDB will usually return the last timestamp in the result. One exception is the `first()` function which will return the first timestamp instead.
+
+For example:
+
+    # Select the last time-stamp and the average over all values.
+    select mean() from `my_series`
+    
+    # Select the first time-stamp and first value:
+    select first() from `my_series`
 List of supported aggregation and filter functions:
 
 limit
@@ -24,7 +34,7 @@ count
 -----
 Syntax:
 
-       count(ts)
+       count([ts])
 
 Returns an integer value.
 
@@ -39,7 +49,7 @@ sum
 ---
 Syntax:
 
-       sum(ts)
+       sum([ts])
 
 Returns an integer or float value depending on the series data type.
 
@@ -55,7 +65,7 @@ max
 ---
 Syntax:
 
-       max(ts)
+       max([ts])
 
 Returns an integer or float value depending on the series data type.
 
@@ -71,7 +81,7 @@ min
 ---
 Syntax:
 
-       min(ts)
+       min([ts])
 
 Returns an integer or float value depending on the series data type.
 
@@ -87,7 +97,7 @@ mean
 ----
 Syntax:
 
-       mean(ts)
+       mean([ts])
 
 Returns a float value.
 
@@ -103,7 +113,7 @@ median
 ------
 Syntax:
 
-       median(ts)
+       median([ts])
 
 Returns a float value.
 
@@ -113,7 +123,7 @@ median_high
 -----------
 Syntax:
 
-       median_high(ts)
+       median_high([ts])
 
 Returns an integer or float value depending on the series data type.
 
@@ -123,7 +133,7 @@ median\_low
 -----------
 Syntax:
 
-       median_low(ts)
+       median_low([ts])
 
 Returns an integer or float value depending on the series data type.
 
@@ -133,7 +143,7 @@ variance
 --------
 Syntax:
 
-       variance(ts)
+       variance([ts])
 
 Returns a float value.
 
@@ -143,7 +153,7 @@ pvariance
 ---------
 Syntax:
 
-       pvariance(ts)
+       pvariance([ts])
 
 Returns a float value.
 
@@ -205,3 +215,43 @@ Example:
 
     # Select all positive values from 'series-001'
     select filter(> 0) from 'series-001'
+
+
+first
+-----
+Syntax:
+
+    first([ts])
+    
+Returns the first value in each `ts` time window. (Or just the first value)
+
+Example:
+    
+    # Select the first value from 'series-001'
+    select first() from 'series-001'
+    
+    # Select the first value per day from 'series-001'
+    select first(1d) from 'series-001'
+    
+    # Select the first value in 2018 from 'series-001'
+    select first() from 'series-001' after '2018'
+    
+    
+last
+----
+Syntax:
+
+    last([ts])
+    
+Returns the last value in each `ts` time window. (Or just the last value)
+
+Example:
+    
+    # Select the last value from 'series-001'
+    select last() from 'series-001'
+    
+    # Select the last value per day from 'series-001'
+    select last(1d) from 'series-001'
+    
+    # Select the last value in 2017 from 'series-001'
+    select last() from 'series-001' before '2018'
\ No newline at end of file
index fdd103a758ce1873a5d59dcbfb7b59940144b425..570e24d6a987603ee0eea63d7ffc8cb092e0bc86 100644 (file)
@@ -26,7 +26,11 @@ Series can be matched using different methods. Groups can help to quickly get th
 
 syntax:
 
-       <series_name | regular_expression | group> [update_function <match_series>]
+       <*/all | series_name | regular_expression | group> [update_function <match_series>]
+
+*/all
+-----
+All series are selected.
 
 series name
 -----------
index 9c1ba7a9107cc596465ab55ff2610468be57f855..2603aca5ff9f7a55e56974a18ffc8e8acd116bc3 100644 (file)
@@ -13,11 +13,14 @@ columns
 Valid columns are:
 
 - active_handles: Returns the active handles which can be used as an indicator on how busy a server is.
+- active_tasks: Returns the active tasks for the current database.
 - address: Server address.
 - buffer_path: Path where this server keeps the buffer file.
 - buffer_size: Size the server uses for one series in the buffer.
 - dbpath: Path where the server stores the database.
 - fifo_files: Number of fifo files which are used to update the replica server. This value is 0 if the server has no replica. A value greater than 1 could be an indication that replication is not working.
+- idle_percentage: Returns percentage of idle time since the database was loaded.
+- idle_time: Returns the idle time in seconds since the database was loaded.
 - ip_support: IP Support setting on the server. (ALL/ IPV4ONLY/ IPV6ONLY)
 - libuv: Version of libuv library.
 - log_level: Current loglevel for the server.
index 665229c27ce9d792b8e1edb5b0d70072e69b8df5..a9883eb611dd83dc140cc60c7745dd2cda377054 100644 (file)
@@ -8,6 +8,7 @@ Syntax
 See available options for more info on each show command:
 
 - `show active_handles`: Returns the active handles which can be used as an indicator for how busy a server is.
+- `show active_tasks`: Returns the active tasks for the current database.
 - `show buffer_path`: Returns the local buffer path on *this* server.
 - `show buffer_size`: Returns the buffer size in bytes on *this* server.
 - `show dbname`: Returns the database name.
@@ -16,6 +17,8 @@ See available options for more info on each show command:
 - `show duration_log`: Returns the sharding duration for log data on *this* database (not supported yet).
 - `show duration_num`: Returns the sharding duration for num data on *this* database.
 - `show fifo_files`: Returns the number of fifo files which are used to update the replica server. This value is 0 if the server has no replica. A value greater than 1 could be an indication that replication is not working.
+- `show idle_percentage`: Returns percentage of idle time since the database was loaded.
+- `show idle_time`: Returns the idle time in seconds since the database was loaded.
 - `show ip_support`: Returns the ip support setting on *this* server.
 - `show libuv`: Returns the version of libuv on *this* server.
 - `show list_limit`: Returns the maximum value which can be used as limit in a list query.